from bs4 import BeautifulSoup

soup = BeautifulSoup("""<div>
    <p><span><b>test</b></span></p>
</div>
""")

element = soup.p.string
print(element)          
print(type(element))    